<template>
  <div class="col p10 card">
    <label class="title">外推货测试</label>
    <div class="row_center mt">
      <el-button @click="onClickFront" type="primary">前进</el-button>
      <el-button @click="onClickBack" type="primary">后退</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from 'vue';
import { dialog } from '../../service/ui';
import { extern_push_ctrl } from '../../service/main_cmd';

interface Ctx {
  distance: string,
}

const ctx = reactive<Ctx>({
  distance: '0'
});

async function onClickFront() {
  try {
    await extern_push_ctrl(0);
    dialog.succ('执行成功');
  } catch (msg) {
    dialog.err(msg);
  }
}

async function onClickBack() {

  try {
    await extern_push_ctrl(1);
    dialog.succ('执行成功');
  } catch (msg) {
    dialog.err(msg);
  }
}


</script>
